package gpar.ep;

import gpar.Settings;

public class Method // implements Exressionable
{
    private Grammar grammar;
    private String name;
    private String variableAssignment = ""; 
    
    public Method(String name)  
    {
        grammar = new Grammar("statements", null);
     
        try 
        { 
            String[] variableAssignments = Settings.eventNamesAndVariables.get(name);
            variableAssignment = variableAssignments[0] + " = " + variableAssignments[1] + ";\n";
        }
        catch (Exception e) {  }
    }

    public String output()  
    {
        String output = "public void " + name + "\n{\n";
        output += variableAssignment;
        output += grammar.output();
        output += "}";
        return output;
    }

    public void mutate()
    {

    }
}
